-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(render-engine): facade adds onCellPointerOver,onCellDragOver,onCellDrop #2240
Conversation
aa2bfa2
to
e387862
Compare
View Deployment
|
d57d3ac
to
f9d27c7
Compare
981a541
to
c630b06
Compare
Origin Title: feat(render-engine): facade adds onCellPointerOver,onCellDragOver,onCellDrop Title: feat(render-engine): facade adds onCellPointerOver,onCellDragOver,onCellDrop
How to test? Paste the following codes in the console to test the API and refresh the page each time. window.univerAPI.getSheetHooks().onCellPointerMove((cell) => {
// Get the cell currently pointed by the mouse
console.log(cell?.location.row, cell?.location.col);
}) When the mouse hovers in the sheet area, it is triggered following the mouse movement. window.univerAPI.getSheetHooks().onCellPointerOver((cell) => {
// Get the cell currently pointed by the mouse
console.log(cell?.location.row, cell?.location.col);
}) It is triggered when the mouse hovers in the sheet area and hits different cells. window.univerAPI.getSheetHooks().onCellDragOver((cell) => {
// Get the cell currently pointed by the mouse
console.log(cell?.location.row, cell?.location.col);
}) Drag a draggable element (such as local notepad text) from outside to the sheet area, and trigger when hitting different cells. window.univerAPI.getSheetHooks().onCellDrop((cell) => {
// Get the cell currently pointed by the mouse
console.log(cell?.location.row, cell?.location.col);
}) Drag a draggable element (such as local notepad text) from outside to the sheet area, and trigger when the mouse is released. |
76df4be
to
5dc59a6
Compare
…Over,onCellDragOver,onCellDrop
5dc59a6
to
e64a146
Compare
如何测试?
分别在控制台粘贴以下代码测试 API,测试一个刷新一次页面
鼠标hover在sheet区域,跟随鼠标移动触发
鼠标hover在sheet区域,打中不同单元格时才触发
从外部拖拽一个可拖拽元素(比如本地记事本的文本)到sheet区域,打中不同单元格时触发
从外部拖拽一个可拖拽元素(比如本地记事本的文本)到sheet区域,松开鼠标时触发